import React from 'react';

const List = ({list,del,toggleItem}) => {
    return <ul>
        {
            list.map(item => (
                <li key={item.id}>
                    <span>{item.title}</span>
                    <button onClick={() => del(item.id)}>X</button>
                </li>
            ))
        }
    </ul>
}

export default List;